Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 2, 2025

This PR contains the POC span streaming implementation for browser SDKs.

Can be tested on @sentry/[email protected] and any higher-level SDKs.

To opt into span streaming, set:

Sentry.init({
  dsn: '...',
  tracesSampleRate: 1,
  traceLifecycle: 'stream', <-- 
  integrations: [
    Sentry.browserTracingIntegration();
    Sentry.spanStreamingIntegration(); <-- 
  ],

  // if you use beforeSendSpan, you have to opt into the new serialized span format:
  beforeSendSpan: withStreamSpan(serializedSpan => {
     // do something
     return serializedSpan
   }),
})

Also note that spans will no longer be sent to any event processors added via one if the *.addEventProcessor APIs. If you have any event processors, consider using beforeSendSpan or ignoreSpans.

@Lms24 Lms24 changed the title feat: Span Streaming POC [WIP] feat: Span Streaming POC Oct 2, 2025
@Lms24 Lms24 self-assigned this Oct 2, 2025
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 31db546 to 20590fe Compare October 2, 2025 14:59
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.74 kB +0.44% +106 B 🔺
@sentry/browser - with treeshaking flags 23.25 kB +0.55% +126 B 🔺
@sentry/browser (incl. Tracing) 41.39 kB +1% +408 B 🔺
@sentry/browser (incl. Tracing, Profiling) 45.65 kB +0.87% +391 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.74 kB +0.54% +422 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.43 kB +0.59% +403 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.45 kB +0.51% +422 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.64 kB +0.47% +443 B 🔺
@sentry/browser (incl. Feedback) 41.42 kB +0.27% +108 B 🔺
@sentry/browser (incl. sendFeedback) 29.41 kB +0.34% +99 B 🔺
@sentry/browser (incl. FeedbackAsync) 34.35 kB +0.33% +111 B 🔺
@sentry/react 26.44 kB +0.43% +112 B 🔺
@sentry/react (incl. Tracing) 43.38 kB +0.95% +406 B 🔺
@sentry/vue 29.52 kB +1.35% +393 B 🔺
@sentry/vue (incl. Tracing) 43.2 kB +0.97% +414 B 🔺
@sentry/svelte 24.77 kB +0.49% +119 B 🔺
CDN Bundle 27 kB +0.38% +102 B 🔺
CDN Bundle (incl. Tracing) 41.94 kB +0.74% +307 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.21 kB +0.4% +311 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.69 kB +0.37% +307 B 🔺
CDN Bundle - uncompressed 79.13 kB +0.31% +239 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 124.7 kB +0.99% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 239.92 kB +0.52% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 252.68 kB +0.49% +1.22 kB 🔺
@sentry/nextjs (client) 45.51 kB +0.88% +393 B 🔺
@sentry/sveltekit (client) 41.8 kB +0.96% +397 B 🔺
@sentry/node-core 50.91 kB +0.19% +96 B 🔺
⛔️ @sentry/node (max: 158 kB) 158.3 kB +0.27% +418 B 🔺
@sentry/node - without tracing 92.81 kB +0.13% +114 B 🔺
@sentry/aws-serverless 106.52 kB +0.1% +98 B 🔺
@sentry/browser (incl. Tracing with Span Streaming) 42.95 kB added added

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,628 - 8,737 -1%
GET With Sentry 1,325 15% 1,353 -2%
GET With Sentry (error only) 5,966 69% 6,020 -1%
POST Baseline 1,157 - 1,196 -3%
POST With Sentry 499 43% 505 -1%
POST With Sentry (error only) 1,041 90% 1,049 -1%
MYSQL Baseline 3,283 - 3,278 +0%
MYSQL With Sentry 424 13% 489 -13%
MYSQL With Sentry (error only) 2,699 82% 2,685 +1%

View base workflow run

@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 2 times, most recently from 84ec3fe to 4c1a555 Compare October 15, 2025 14:50
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from dc5f6de to a2aec25 Compare October 16, 2025 12:06
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 7bb62f4 to fd533f3 Compare October 31, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants